import { createBrowserRouter } from 'react-router-dom'
import Login from '@/views/Login'
import Admin from '@/views/Admin'

import routes from './routes'

const router = createBrowserRouter([
  {
    path: '/login',
    element: <Login />
  },
  {
    path: '/',
    element: <Admin />,
    // 协变 -- ts类型推导特性
    children: routes
  }
])

export default router
